#include <memory>
#include <string>
using std::string;
using std::shared_ptr;

class autofile {
public:
	autofile(const string filename_);
	~autofile();

	static shared_ptr<autofile> read_file(const string filename);

	void read_content();
	char *get_str();
	bool is_open();

private:
	bool open;
	string filename;
	FILE *fp;
	char *content;
	int length;
};
